var commonSrv = {
	/**************************   登录    **************************/
	/**
	 * 登录操作
	 * @param  {[type]} data     [{pwd:密码, userName:用户名}]
	 */
	login: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '登录操作',
			url: '/login.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 登出系统
	 * @param  {[type]} data     [{}]
	 */
	logout: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '登出系统',
			url: '/loginOut.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取当前登录的用户的所有权限
	 * @param  {[type]} data     [{}]
	 */
	getPermissionList: function(data, success, fail, complete) {
		Tools.ajax_({
			title: '获取当前登录的用户的所有权限',
			url: '/ta/PermissionCtrl/getPermissionList.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**************************   用户管理    **************************/
	/**
	 * 用户管理列表
	 * @param  {[type]} data     [{curPage: 要访问第几页, pagesize: 每页记录数}]
	 */
	getUserList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '用户管理列表',
			url: '/ta/UserCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**
	 * 添加用户
	 * @param  {[type]} data     
	 * {
	 * 	email: 邮箱, 
	 * 	mobile: 手机号码, 
	 * 	name: 显示名, 
	 * 	pwd: 密码, 
	 * 	sex: 性别（1男，2女）, 
	 * 	userName: 登陆名, 
	 * 	userroleIds: 用户拥有的角色id，多个用逗号隔开
	 * }
	 */
	addUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加用户',
			url: '/ta/UserCtrl/addUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**
	 * 修改用户
	 * @param  {[type]} data     
	 * {
	 * 	email: 邮箱, 
	 * 	mobile: 手机号码, 
	 * 	name: 显示名,
	 * 	sex: 性别（1男，2女）,
	 * 	userId: 用户Id 
	 * 	userName: 登陆名,
	 * 	userroleIds: 用户拥有的角色id，多个用逗号隔开
	 * }
	 */
	editUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改用户',
			url: '/ta/UserCtrl/editUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**
	 * 删除用户
	 * @param  {[type]} data     [{userId: 用户Id}]
	 */
	delUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除用户',
			url: '/ta/UserCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改用户密码
	 * @param  {[type]} data     [{userId: 用户Id, pwd: 密码}]
	 */
	updatePwd: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改用户密码',
			url: '/ta/UserCtrl/updatePwd.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取角色下拉列表数据---添加用户页面，角色的下拉选择列表数据
	 * @param  {[type]} data     [{}]
	 */
	getAllRoleList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取角色下拉列表数据',
			url: '/ta/UserroleCtrl/getUserroles.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**
	 * 获取单个用户信息
	 * @param  {[type]} data     [{userId: 用户唯一id}]
	 */
	getUserById: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取单个用户信息',
			url: '/ta/UserCtrl/getUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**************************   角色管理    **************************/
	/**
	 * 角色管理列表
	 * @param  {[type]} data     [{curPage: 要访问第几页, pagesize: 每页记录数}]
	 */
	getRoleList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '角色管理列表',
			url: '/ta/UserroleCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取用户下拉列表数据
	 * @param  {[type]} data     [{userId: 用户唯一id}]
	 */
	getAllUserList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取用户下拉列表数据',
			url: '/ta/UserCtrl/getUsers.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加角色
	 * @param  {[type]} data     []
	 * {
	 * 	description: 角色描述, 
	 * 	name: 角色名称, 
	 * 	permissionIds: 角色包含的权限id，多个用逗号隔开,
	 * 	userIds: 使用该角色的用户id，多个用逗号隔开
	 * }
	 */
	addRole: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加角色',
			url: '/ta/UserroleCtrl/addUserrole.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除角色
	 * @param  {[type]} data     [{userroleId: 角色唯一Id}]
	 */
	delRole: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除角色',
			url: '/ta/UserroleCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改角色
	 * @param  {[type]} data     []
	 * {
	 * 	description: 角色描述, 
	 * 	name: 角色名称, 
	 * 	permissionIds: 角色包含的权限id，多个用逗号隔开,
	 * 	userIds: 使用该角色的用户id，多个用逗号隔开,
	 * 	userroleId: 角色唯一id
	 * }
	 */
	editRole: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改角色',
			url: '/ta/UserroleCtrl/editUserrole.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取单个角色信息
	 * @param  {[type]} data     [userroleId: 角色Id]
	 */
	getRoleById: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取单个角色信息',
			url: '/ta/UserroleCtrl/getUserrole.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},

	/**************************   园所档案    **************************/
	/**
	 * 编辑园所基本信息表单
	 * @param  {[type]} data     [{}]
	 */
	getSchoolForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '编辑园所基本信息表单',
			url: '/ta/SchoolCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 编辑园所基本信息
	 * @param  {[type]} data     [{}]
	 * {
	 *   address: 地址,
	 *   beginDate: 建园日期,
	 *   code: 园所编码,
	 *   email: 邮箱地址,
	 *   innerArea: 室内面积,
	 *   logo: 园所图标，调用公共接口的上传图片接口获取到的data,
	 *   maxClassCount: 最大班级数,
	 *   maxStudentCount: 最大学生数,
	 *   name: 园所名称,
	 *   outerArea: 室外面积,
	 *   principal: 园长姓名,
	 *   simpleName: 园所简称,
	 *   site: 园所网址,
	 *   tel: 电话,
	 *   totalArea: 总面积,
	 *   weiParentLogo: 微信家长端首页图标,
	 *   weiTeacherLogo: 微信教师端首页图标,
	 *   zipCode: 邮编
	 * }
	 */
	editSchool: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '编辑园所基本信息',
			url: '/ta/SchoolCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**************************   学年管理    **************************/
	/**
	 * 学年管理列表
	 * @param  {[type]} data     [{curPage: 要访问第几页, pagesize: 每页记录数}]
	 */
	getYearList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '学年管理列表',
			url: '/ta/SchoolyearCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 设置当前学年
	 * @param {[type]} data     [{schoolyearId: 学年Id}]
	 */
	setCurYear: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '设置当前学年',
			url: '/ta/SchoolyearCtrl/setCurrent.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加学年提交
	 * @param {[type]} data     [{year: 年份, name: 名称(year-year+1学年；如年份填2018年则名称为：2018-2019学年)}]
	 */
	addYear: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加学年提交',
			url: '/ta/SchoolyearCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除学年
	 * @param {[type]} data     [{schoolyearId: 学年Id}]
	 */
	delYear: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除学年',
			url: '/ta/SchoolyearCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改学年提交
	 * @param {[type]} data     [{ }]
	 * {
	 *   endDate: 学年结束日期,
	 *   firstEndDate: 上学期结束日期,
	 *   firstStartDate: 上学期开始日期,
	 *   name: 名称,
	 *   schoolyearId: 学年Id,
	 *   secondEndDate: 下学期结束日期,
	 *   secondStartDate: 下学期开始日期,
	 *   startDate: 学年开始日期
	 * }
	 */
	editYear: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改学年提交',
			url: '/ta/SchoolyearCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改学年表单
	 * @param {[type]} data     [{schoolyearId: 学年Id}]
	 */
	getEditYearForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改学年表单',
			url: '/ta/SchoolyearCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取学年下拉列表数据
	 * @param  {[type]} data     [{}]
	 */
	getSchoolYears: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取学年下拉列表数据',
			url: '/ta/SchoolyearCtrl/getSchoolYears.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**************************   老师管理    **************************/
	/**
	 * 教师列表
	 * @param {[type]} data     [{curPage: 要访问第几页, pagesize: 每页记录数}]
	 */
	getTeacherList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '教师列表',
			url: '/ta/TeacherCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加教师提交
	 * @param {[type]} data     [{}]
	 * {
	 *   address: 家庭地址,
	 *   birthday: 生日,
	 *   code: 员工编号,
	 *   contact: 紧急联系人,
	 *   contactTel: 紧急联系电话,
	 *   countryId: 国籍,
	 *   education: 学历,
	 *   email: 电子邮件,
	 *   homePostcode: 家庭邮编,
	 *   homeTel: 家庭电话,
	 *   joinedDate: 入职日期,
	 *   maritalStatus: 婚姻状态： 1未婚 2已婚 3离异 4丧偶,
	 *   mobile: 手机,
	 *   name: 姓名,
	 *   school: 毕业院校,
	 *   sex: 性别 1男 2女,
	 *   status: 状态：1在职 2离职 3退休,
	 *   tel: 办公电话,
	 *   title: 职务,
	 *   userId: 关联的用户id
	 * }
	 */
	addTeacher: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加教师提交',
			url: '/ta/TeacherCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加教师表单
	 * @param {[type]} data     [{}]
	 */
	getTeacherAddForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加教师表单',
			url: '/ta/TeacherCtrl/addForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除教师
	 * @param {[type]} data     [{}]
	 */
	delTeacher: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除教师',
			url: '/ta/TeacherCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改教师提交
	 * @param {[type]} data     [{}]
	 * {
	 *   address: 家庭地址,
	 *   birthday: 生日,
	 *   code: 员工编号,
	 *   contact: 紧急联系人,
	 *   contactTel: 紧急联系电话,
	 *   countryId: 国籍,
	 *   education: 学历,
	 *   email: 电子邮件,
	 *   homePostcode: 家庭邮编,
	 *   homeTel: 家庭电话,
	 *   joinedDate: 入职日期,
	 *   maritalStatus: 婚姻状态： 1未婚 2已婚 3离异 4丧偶,
	 *   mobile: 手机,
	 *   name: 姓名,
	 *   school: 毕业院校,
	 *   sex: 性别 1男 2女,
	 *   status: 状态：1在职 2离职 3退休,
	 *   teacherId: 教师唯一id
	 *   tel: 办公电话,
	 *   title: 职务,
	 *   userId: 关联的用户id
	 * }
	 */
	editTeacher: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改教师提交',
			url: '/ta/TeacherCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改教师表单
	 * @param {[type]} data     [{teacherId: 教师唯一id}]
	 */
	getTeacherEditForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改教师表单',
			url: '/ta/TeacherCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**************************   班级管理    **************************/
	/**
	 * 修改班级其他老师提交
	 * @param {[type]} data     [{}]
	 * {
	 *   classesId: 班级唯一id,
	 *   classesUserId: 班级和老师对应关系表的唯一id,
	 *   relationName: 	关系,
	 *   userId: 教师用户id
	 * }
	 */
	editOtherUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改班级其他老师提交',
			url: '/ta/ClassesCtrl/editOtherUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改班级其他老师表单
	 * @param {[type]} data     [{classesUserId: 班级和老师对应关系表的唯一id}]
	 */
	editOtherUserForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改班级其他老师表单',
			url: '/ta/ClassesCtrl/editOtherUserForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改班级提交
	 * @param {[type]} data     [{}]
	 * {
	 *   calendarId	考勤日历id
	 *   classTypeId	班级类型：对应获取班级类别数据接口中的id
	 *   classesId	班级唯一id,
	 *   description	描述
	 *   logo	园所图标，调用公共接口的上传图片接口获取到的data
	 *   maxQuotas	最大学生数
	 *   name	名称	string	
	 *   schoolYearId	学年id	number	
	 *   sortNum	序号，用于排序，小的排前	number	
	 *   userId	主教老师，对应用户的id	number
	 * }
	 */
	editClasses: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改班级提交',
			url: '/ta/ClassesCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改班级表单
	 * @param {[type]} data     [{classesId: 班级唯一id}]
	 */
	editOtherClassesForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改班级表单',
			url: '/ta/ClassesCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除班级
	 * @param {[type]} data     [{classesId: 班级唯一id}]
	 */
	delClasses: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除班级',
			url: '/ta/ClassesCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除班级其他教师
	 * @param {[type]} data     [{classesUserId: 班级和老师对应关系表的唯一id}]
	 */
	delClassesUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除班级其他教师',
			url: '/ta/ClassesCtrl/delClassesUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 批量开班提交操作
	 * @param {[type]} data     []
	 * {
	 *   classesIds: 要赋值的班级id，多个用逗号隔开
	 *   schoolYearId: 要开班的学年id
	 * }
	 */
	bantchAdd: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '批量开班提交操作',
			url: '/ta/ClassesCtrl/bantchAdd.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加班级其他老师提交
	 * @param {[type]} data     []
	 * {
	 *   classesId	班级唯一id	number	
	 *   relationName	关系	string	
	 *   userId	教师用户id
	 * }
	 */
	addOtherUser: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加班级其他老师提交',
			url: '/ta/ClassesCtrl/addOtherUser.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加班级其他老师表单
	 * @param {[type]} data     [{classesId: 班级唯一id}]
	 */
	addOtherUserForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加班级其他老师表单',
			url: '/ta/ClassesCtrl/addOtherUserForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加班级提交
	 * @param {[type]} data     []
	 * {
	 *   calendarId	考勤日历id	number	
	 *   classTypeId	班级类型：对应获取班级类别数据接口中的id	number	
	 *   description	描述	string	
	 *   logo	园所图标，调用公共接口的上传图片接口获取到的data	string	
	 *   maxQuotas	最大学生数	number	
	 *   name	名称	string	
	 *   schoolYearId	学年id	number	
	 *   sortNum	序号，用于排序，小的排前	number	
	 *   userId	主教老师，对应用户的id	number	
	 * }
	 */
	addClasses: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加班级提交',
			url: '/ta/ClassesCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加班级表单
	 * @param {[type]} data     [{}]
	 */
	addClassesForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加班级表单',
			url: '/ta/ClassesCtrl/addForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 班级列表
	 * @param {[type]} data     [{}]
	 * {
	 *   schoolYearId: 学年id,
	 *   curPage: 	要访问第几页
	 *   pagesize: 每页记录数
	 * }
	 */
	getClassesList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '班级列表',
			url: '/ta/ClassesCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 获取班级类型数据
	 * @param {[type]} data     [{}]
	 */
	getClassTypeList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取班级类型数据',
			url: '/ta/ClassesCtrl/getClassTypeList.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**************************   招生管理    **************************/
	// 渠道
	/**
	 * 渠道列表
	 * @param  {[type]} data     [{curPage	要访问第几页  pagesize	每页记录数}]
	 */
	getChannelList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '渠道列表',
			url: '/ta/ChannelCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改渠道提交
	 * @param  {[type]} data     [{channelId: 渠道唯一id}]
	 * {
	 *   channelId	渠道唯一id	number	
	 *   channelTypeId	渠道分类id	number	
	 *   contact	联系人	string	
	 *   description	描述	string	
	 *   email	邮箱	string	
	 *   mobile	联系手机	string	
	 *   name	名称	string	
	 *   owner	拥有人	number	
	 *   tel	联系电话	string
	 * }
	 */
	editChannel: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改渠道提交',
			url: '/ta/ChannelCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改渠道表单
	 * @param  {[type]} data     [{channelId: 渠道唯一id}]
	 */
	editChannelForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改渠道表单',
			url: '/ta/ChannelCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除渠道
	 * @param  {[type]} data     [{channelId: 渠道唯一id}]
	 */
	delChannel: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除渠道',
			url: '/ta/ChannelCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加渠道提交
	 * @param  {[type]} data     []
	 * {
	 *   channelTypeId	渠道分类id	number	
	 *   contact	联系人	string	
	 *   description	描述	string	
	 *   email	邮箱	string	
	 *   mobile	联系手机	string	
	 *   name	名称	string	
	 *   owner	拥有人	number	
	 *   tel	联系电话	string
	 * }
	 */
	addChannel: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加渠道提交',
			url: '/ta/ChannelCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加渠道表单
	 * @param  {[type]} data     []
	 */
	addChannelForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加渠道表单',
			url: '/ta/ChannelCtrl/addForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 渠道下拉列表
	 * @param  {[type]} data     []
	 */
	getChannels: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '渠道下拉列表',
			url: '/ta/ChannelCtrl/getChannels.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	// 潜在生
	/**
	 * 修改潜在生提交
	 * @param  {[type]} data     []
	 * {
	 *   addDate	录入日期	string	@mock=2017-02-22
	 *   address	家庭地址	string	
	 *   age	年龄	number	@mock=5
	 *   allergy	其他过敏	string	@mock=过敏
	 *   birthday	生日	string	@mock=2012-06-01
	 *   certificationNo	证件号码	string	@mock=324324324
	 *   certificationTypeId	证件类型id	number	@mock=1
	 *   channelId	来源渠道id	number	@mock=2
	 *   channelTag	渠道说明	string	
	 *   city	家庭地址所在市	string	@mock=廊坊
	 *   classTypeId	意向班级类型id	number	@mock=1
	 *   countryId	国籍id	number	@mock=1
	 *   dietaryRequirements	特殊饮食要求	string	@mock=特殊饮食要求
	 *   district	家庭地址所在区	string	
	 *   email	邮箱	string	
	 *   eventId	招生活动id	number	@mock=1
	 *   eventName	招生活动名称	string	@mock=春季招生活动
	 *   focusPointIds	客户关注点id，多个逗号隔开	string	@mock=1,3,5
	 *   foodAllergy	食物过敏	string	@mock=食物过敏
	 *   illnessIds	疾病id，多个逗号隔开	string	@mock=2,5
	 *   illnessNotes	处理建议	string	@mock=处理建议
	 *   inquiryId	潜在生唯一id	number	@mock=1
	 *   isAbandoned	是否放弃 1否 2是	number	@mock=1
	 *   medAllergy	药物过敏	string	@mock=药物过敏
	 *   mobile	联系电话	string	@mock=13765673667
	 *   name	姓名	string	@mock=潜在生1
	 *   nickName	小名	string	
	 *   notes	备注	string	@mock=备注
	 *   owner	跟进人，对应user对象的id	number	@mock=1
	 *   parentName	家长姓名	string	@mock=潜先生
	 *   parentRelationId	家长与孩子的关系id	number	@mock=1
	 *   planJoinDate	计划入学时间	string	@mock=2017-02-22
	 *   progressNotes	最新进展	string	@mock=最新进展
	 *   province	家庭地址所在省	string	@mock=河北省
	 *   sex	性别 1男 2女	number	@mock=1
	 *   status	状态id	number	@mock=1
	 *   tel	家庭联系电话	string	
	 *   zipCode	邮编	string
	 * }
	 */
	editPotential: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改潜在生提交',
			url: '/ta/InquiryCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改潜在生表单
	 * @param  {[type]} data     [{inquiryId: 潜在生id}]
	 */
	editPotentialForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改潜在生表单',
			url: '/ta/InquiryCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除潜在生
	 * @param  {[type]} data     [{inquiryId: 潜在生id}]
	 */
	delPotential: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除潜在生',
			url: '/ta/InquiryCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加潜在生提交
	 * @param  {[type]} data     []
	 * {
	 *   addDate	录入日期	string	@mock=2017-02-22
	 *   address	家庭地址	string	
	 *   age	年龄	number	@mock=5
	 *   allergy	其他过敏	string	@mock=过敏
	 *   birthday	生日	string	@mock=2012-06-01
	 *   certificationNo	证件号码	string	@mock=324324324
	 *   certificationTypeId	证件类型id	number	@mock=1
	 *   channelId	来源渠道id	number	@mock=2
	 *   channelTag	渠道说明	string	
	 *   city	家庭地址所在市	string	@mock=廊坊
	 *   classTypeId	意向班级类型id	number	@mock=1
	 *   countryId	国籍id	number	@mock=1
	 *   dietaryRequirements	特殊饮食要求	string	@mock=特殊饮食要求
	 *   district	家庭地址所在区	string	
	 *   email	邮箱	string	
	 *   eventId	招生活动id	number	@mock=1
	 *   eventName	招生活动名称	string	@mock=春季招生活动
	 *   focusPointIds	客户关注点id，多个逗号隔开	string	@mock=1,3,5
	 *   foodAllergy	食物过敏	string	@mock=食物过敏
	 *   illnessIds	疾病id，多个逗号隔开	string	@mock=2,5
	 *   illnessNotes	处理建议	string	@mock=处理建议
	 *   isAbandoned	是否放弃 1否 2是	number	@mock=1
	 *   medAllergy	药物过敏	string	@mock=药物过敏
	 *   mobile	联系电话	string	@mock=13765673667
	 *   name	姓名	string	@mock=潜在生1
	 *   nickName	小名	string	
	 *   notes	备注	string	@mock=备注
	 *   owner	跟进人，对应user对象的id	number	@mock=1
	 *   parentName	家长姓名	string	@mock=潜先生
	 *   parentRelationId	家长与孩子的关系id	number	@mock=1
	 *   planJoinDate	计划入学时间	string	@mock=2017-02-22
	 *   progressNotes	最新进展	string	@mock=最新进展
	 *   province	家庭地址所在省	string	@mock=河北省
	 *   sex	性别 1男 2女	number	@mock=1
	 *   status	状态id	number	@mock=1
	 *   tel	家庭联系电话	string	
	 *   zipCode	邮编	string
	 * }
	 */
	addPotential: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加潜在生提交',
			url: '/ta/InquiryCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加潜在生表单
	 * @param  {[type]} data     []
	 */
	addPotentialForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加潜在生表单',
			url: '/ta/InquiryCtrl/addForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 潜在生列表
	 * @param  {[type]} data     []
	 * {
	 *   channelId	渠道id	number	
	 *   curPage	要访问第几页	number	
	 *   isMy	是否只显示我的潜在生，2是	number	
	 *   keyword	关键字	string	
	 *   pagesize	每页记录数	number	
	 *   searchTraceDateTypeId	搜索跟踪日期的类型	number	
	 *   status	0全部 1待定 2处理中 3已转预备 4放弃和无效	number	
	 *   tagIds	标签id，多个用逗号隔开	string	
	 *   traceDateEnd	跟踪日期最大值	string	
	 *   traceDateStart	跟踪日期最小值	string
	 * }
	 */
	getPotential: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '潜在生列表',
			url: '/ta/InquiryCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	// 跟踪
	/**
	 * 潜在生跟踪列表
	 * @param  {[type]} data     []
	 * {
	 *   classTypeId	潜在生意向班型id	number	
	 *   createBy	跟进人id	number	
	 *   curPage	要访问第几页	number	
	 *   keyword	关键字	string	
	 *   pagesize	每页记录数	number	
	 *   traceDateEnd	跟进日期最大值	string	@mock=2017-2-1
	 *   traceDateStart	跟进日期最小值	string	
	 * }
	 */
	getTraceList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '潜在生跟踪列表',
			url: '/ta/TrackCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改跟踪提交
	 * @param  {[type]} data     []
	 * {
	 *   inquiryId	潜在生id	number	@mock=1
	 *   notes	跟进进展	string	@mock=跟进进展1
	 *   planNextTrackDate	计划下次跟进日期	string	@mock=2017-02-28 11:23:30.0
	 *   purpose	跟进目的	string	@mock=目的
	 *   trackDate	跟进日期	string	@mock=2017-02-26
	 *   trackId	跟踪记录唯一id	number	@mock=1
	 * }
	 */
	editTrace: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改跟踪提交',
			url: '/ta/TrackCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改跟踪表单
	 * @param  {[type]} data     [trackId	跟踪记录唯一id	]
	 */
	editTraceForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改跟踪表单',
			url: '/ta/TrackCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除跟踪
	 * @param  {[type]} data     [{trackId	跟踪唯一id}]
	 */
	delTrace: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除跟踪',
			url: '/ta/TrackCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加跟踪提交
	 * @param  {[type]} data     []
	 * {
	 *   nquiryId	潜在生id	number	@mock=1
	 *   notes	跟进进展	string	@mock=跟进进展1
	 *   planNextTrackDate	计划下次跟进日期	string	@mock=2017-02-28 11:23:30.0
	 *   purpose	跟进目的	string	@mock=目的
	 *   trackDate	跟进日期	string	@mock=2017-02-26
	 * }
	 */
	addTrace: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加跟踪提交',
			url: '/ta/TrackCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	// 潜在生
	/**
	 * 潜在生列表
	 * @param  {[type]} data     []
	 * { 
	 *   channelId	渠道id	number	
	 *   curPage	要访问第几页	number	
	 *   isMy	是否只显示我的潜在生，2是	number	
	 *   keyword	关键字	string	
	 *   pagesize	每页记录数	number	
	 *   searchTraceDateTypeId	搜索跟踪日期的类型	number	
	 *   status	0全部 1待定 2处理中 3已转预备 4放弃和无效	number	
	 *   tagIds	标签id，多个用逗号隔开	string	
	 *   traceDateEnd	跟踪日期最大值	string	
	 *   traceDateStart	跟踪日期最小值	string
	 * }
	 */
	getInquiryList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '潜在生列表',
			url: '/ta/InquiryCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	// 预约
	/**
	 * 修改预约提交
	 * @param  {[type]} data     []
	 * { 
	 *   appointmentId	预约记录唯一id	number	@mock=1
	 *   eventId	招生活动唯一id	number	@mock=1
	 *   feedback	反馈	string	@mock=反馈
	 *   inquiryId	潜在生唯一id	number	@mock=1
	 *   notes	备注	string	@mock=备注
	 *   owner	邀约人id	number	@mock=1
	 *   purposeId	邀约目的id	number	@mock=1
	 *   status	状态id	number	@mock=1
	 *   visitTime	到访时间	string	@mock=2017-03-01 15:18:34.0
	 * }
	 */
	editAppointment: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改预约提交',
			url: '/ta/AppointmentCtrl/edit.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 修改预约表单
	 * @param  {[type]} data     [{appointmentId	预约记录唯一id	number	@mock=1}]
	 */
	editAppointmentForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '修改预约表单',
			url: '/ta/AppointmentCtrl/editForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 删除预约
	 * @param  {[type]} data     [{appointmentId	预约记录唯一id	number	@mock=1}]
	 */
	delAppointment: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '删除预约',
			url: '/ta/AppointmentCtrl/del.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加预约提交
	 * @param  {[type]} data     []
	 * { 
	 *   eventId	招生活动唯一id	number	@mock=1
	 *   feedback	反馈	string	@mock=反馈
	 *   inquiryId	潜在生唯一id	number	@mock=1
	 *   notes	备注	string	@mock=备注
	 *   owner	邀约人id	number	@mock=1
	 *   purposeId	邀约目的id	number	@mock=1
	 *   status	状态id	number	@mock=1
	 *   visitTime	到访时间	string	@mock=2017-03-01 15:18:34.0
	 * }
	 */
	addAppointment: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加预约提交',
			url: '/ta/AppointmentCtrl/add.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 添加预约表单
	 * @param  {[type]} data     []
	 */
	addAppointmentForm: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '添加预约表单',
			url: '/ta/AppointmentCtrl/addForm.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 预约到访列表
	 * @param  {[type]} data     [curPage: 要访问第几页, pagesize	每页记录数]
	 */
	getAppointmentList: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '预约到访列表',
			url: '/ta/AppointmentCtrl/list.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**************************   考勤管理    **************************/

	/**************************   公用    **************************/
	/**
	 * 获取城市数组
	 * @param  {[type]} data     [{}]
	 */
	getAllCity: function (data, success, fail, complete) {
		Tools.ajax_({
			title: '获取城市数组',
			url: '/ta/CityCtrl/getAllCity.do',
			data: data, 
			success: function(result) {
				success(result);
			},
			fail: function(result) {
				fail(result);
			},
			complete: function() {
				complete();
			}
		});
	},
	/**
	 * 上传图片接口
	 * @param  {[type]} data     [{file	文件本地路径}]
	 */
	uploadPic: function (data, success, fail, complete) {
		$.ajax({
			url: Tools.config.domain + '/ta/UploadCtrl/uploadPic.do',
			data: data,
			type: 'POST',
    		cache: false,
		    data: data,
		    processData: false,
		    contentType: false,
			success: function(result) {
				if(result.status == 0) {
					success(result);
				}
			},
			fail: function(result) {
				if(result.status == 3 || result.status == 1) {
					alert(result.msg);
				}
				fail(result);
			},
			complete: function() {
				complete();
			}
		})
	},

	/**
	 * 随机生成字符串
	 * @param  {[boolean]} randomFlag [是否任意长度]
	 * @param  {[string]} min        [任意长度最小位]
	 * @param  {[string]} max        [任意长度最大位]
	 * @return {[string]}            [生成的字符串]
	 */
	randomStr: function(randomFlag, min, max) {
		var str = "",
			range = min,
			// arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
			// 由大写字母和数字组成
			arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
		// 随机产生
		if(randomFlag){
			range = Math.round(Math.random() * (max-min)) + min;
		}
		for(var i=0; i<range; i++){
			pos = Math.round(Math.random() * (arr.length-1));
			str += arr[pos];
		}
		return str;
	}
}

$(document).on('click', '.form-title-btn', function() {
	if(!$(this).hasClass('active')) {
		$(this).addClass('active');
	} else {
		$(this).removeClass('active');
	}
	$(this).parents('.form-header').next('.form-body').toggle();
});